package mercede.allBean;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import mercede.allDTOs.personpkDTO;
import mercede.allManagers.PersonpkManager;


@ManagedBean(name="personpkbean")
@RequestScoped
public class PersonpkBean {
	
	@EJB
	private PersonpkManager personpkmgr;

	private personpkDTO persondto;
	
	public PersonpkBean()
	{
		setPersondto(new personpkDTO());
	}

	public personpkDTO getPersondto() {
		return persondto;
	}

	public void setPersondto(personpkDTO persondto) {
		this.persondto = persondto;
	}
	
	public String register() {
		personpkmgr.save(persondto);
		return "home?faces-redirect=true";
	}

}
